using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//游戏控制管理，负责控制游戏的整个逻辑
public class GameController : MonoBehaviour
{
    private static GameController _instance;
    public static GameController Instance
    {
        get
        {
            return _instance;
        }
    }

    public Level level;
    private GameManager mGameManager;

    public int[] mMonsterIDList;//当前波次的产怪列表
    public int mMonsterIDIndex;
    public Stage currentStage;
    public NormalMordelPanel normalMordelPanel;
    public MapMaker mapMaker;

    private void Awake()
    {
#if Game
        _instance = this;
        mGameManager = GameManager.Instance;
        currentStage = mGameManager.currentStage;
        normalMordelPanel = mGameManager.uiManager.mUIFacade.currentScenePanelDict[StringManager.NormalMordelPanel] as NormalMordelPanel;
        mapMaker = GetComponent<MapMaker>();
        mapMaker.InitMapMaker();
        mapMaker.LoadMap(currentStage.mBigLevelID, currentStage.mLevelID);
#endif

    }

    /// <summary>
    /// 资源获取方法
    /// </summary>
    /// <param name="resourcePath"></param>
    /// <returns></returns>
    public Sprite GetSprite(string resourcePath)
    {
        return mGameManager.GetSprite(resourcePath);
    }
    public AudioClip GetAudioClip(string resourcePath)
    {
        return mGameManager.GetAudioClip(resourcePath);
    }
    public RuntimeAnimatorController GetRuntimeAnimatorController(string resourcePath)
    {
        return mGameManager.GetRuntimeAnimatorController(resourcePath);
    }
    public GameObject GetGameObjectResource(string resourcePath)
    {
        return mGameManager.GetGameObjectResource(FactoryType.GameFactory, resourcePath);
    }
    public void PushGameObjectToFactory(string resourcePath, GameObject itemGo)
    {
        mGameManager.PushGameObjectToFactory(FactoryType.GameFactory, resourcePath, itemGo);
    }

}
